#ifndef SHADER_HH_
# define SHADER_HH_

#   include "tools/constants.hh"
#   include <sstream>

typedef unsigned int GLuint; // avoiding including whole file || common/stl.h

class Shader
{
    public:
        /** autobuild filenames: add prefix && suffix .{vert,frag} */
        Shader(std::string basename);

        /** Sending vertex && fragment shaders files */
        Shader(const std::string v_filename, const std::string f_filename);

        /** Default destructor */
        virtual ~Shader();

        unsigned int getProgramId();

        bool init();
        bool load();
        bool compile();
        bool execute();
        void destroy();

    private:
        unsigned int _vId;       /// vertex   shader id
        unsigned int _fId;       /// fragment shader id
        GLuint _programId;
        std::string _vFilename;	 /// vertex   file name
        std::string _fFilename;  /// fragment file name
        std::string _vSrc; /// vertex   shader source code
	std::string _fSrc; /// fragment shader source code
};

#endif // SHADER_HH_
